package com.cskaoyan.javase.homework.day05;

/**
 * @description: 面向对象基础语法练习
 * @author: wuguidong@cskaoyan.onaliyun.com
 **/

import com.sun.xml.internal.ws.api.message.MessageWritable;

/**
 *
 */
public class StudentDemo {
    public static void main(String[] args) {
        Student s = new Student();
        s.name = "法外狂徒-张三";
        s.age = 28;
        s.gender = "男";
        s.age = 18;
        s.printStu();

        Student s2 = new Student();
        s2.name = "最强男团-赵四";
        s2.age = 38;
        s2.gender = "男";
        s2.age = 10;
        s2.printStu();

        Student s3 = new Student();
        System.out.println(s3.name);
        s3.creatStu("张三", 13, "男", 9);
        s3.printStu();
    }
}

class Student {
    //成员变量
    String name;
    int age;
    //isMale isFemale
    String gender;
    // 布尔类型决定性别，这种写法是可以的。但是不推荐，尽量不要这么使用
    // boolean isMale;
    int stuId;

    public void printStu() {
        System.out.println("该学生姓名为:" + this.name + "年龄是" + this.age + "学号为" + this.stuId + "性别为" + this.gender);
    }

    public void creatStu(String name, int age, String gender, int stuId) {
        this.name = name;
        this.age = age;
        this.gender = gender;
        this.stuId = stuId;
    }
}